﻿using System;
using CTEM.Controllers.Global;


/// <summary>
/// Entity for table Warehouse
/// </summary>

namespace CTEM.Models
{
    public class WH_WarehouseDTO
    {
        public long WarehouseID { get; set; }
        public string WarehouseName { get; set; }
        public long ConstructionID { get; set; }
        public string ManagerName { get; set; }
        public string Description { get; set; }
        public string Address { get; set; }
        public bool IsActive { get; set; }
        public bool IsDelete { get; set; }
        public string CreatedBy { get; set; }
        public DateTime CreatedDate { get; set; }
        public string UpdatedBy { get; set; }
        public DateTime LastUpdated { get; set; }

        public HistoryLevel History { get; set; }

        public WH_WarehouseDTO()
        {
            WarehouseID = 0;
            WarehouseName = Constants.EMPTY_TEXT;
            ConstructionID = 0;
            ManagerName = Constants.EMPTY_TEXT;
            Description = Constants.EMPTY_TEXT;
            Address = Constants.EMPTY_TEXT;
            IsActive = true;
            IsDelete = false;
            CreatedBy = Global.CurrentUser.Username;
            CreatedDate = DateTime.Today;
            UpdatedBy = Global.CurrentUser.Username;
            LastUpdated = DateTime.Today;
        }
        
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(WH_WarehouseDTO)) return false;
            return Equals((WH_WarehouseDTO)obj);
        }

        public bool Equals(WH_WarehouseDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.WarehouseID, WarehouseID);
        }

        public static bool operator ==(WH_WarehouseDTO left, WH_WarehouseDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(WH_WarehouseDTO left, WH_WarehouseDTO right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

    }
   
}